<?php

/*

Item Helper (item_helper.php)

*/

$rank_check = 1;
$page_title = "Item Helper";
include "header.inc.php";


if (!$min) { $min = 0; }

$query = mysql_query("SELECT * FROM usersitems2 WHERE owner = '$userid' AND game = '$game' ORDER BY item_id");

echo $openHTML;

if ($check_all == "stock") { $check[stock] = " CHECKED"; }
if ($check_all == "discard") { $check[discard] = " CHECKED"; }
if ($check_all == "donate") { $check[donate] = " CHECKED"; }
if ($check_all == "deposit") { $check[deposit] = " CHECKED"; }
if ($check_all == "give") { $check[give] = " CHECKED"; }
if ($check_all == "gallery") { $check[gallery] = " CHECKED"; }
if (!$check_all) { $check[keep] = " CHECKED"; }

while ($array = mysql_fetch_array($query))
{
	$get_item = fetch("SELECT * FROM items2 WHERE id = '$array[item_id]' AND game = '$game'");
	$cellcolor = alternate($cellcolor,"$reallyLight","#FFFFFF");
	$id = $array[id];

	$itemList .= "
	<TR BGCOLOR=\"$cellcolor\" width=100%>
	<TD>
	<p>$get_item[item_name]</p>
	</TD>
	<TD>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=keep$check[keep]></CENTER>
	</TD>
	<TD width=50>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=stock$check[stock]></CENTER>
	</TD>
	<TD width=50>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=discard$check[discard]></CENTER>
	</TD>
	<TD width=50>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=donate$check[donate]></CENTER>
	</TD>
	<TD width=50>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=gallery$check[gallery]></CENTER>
	</TD>
	<TD width=50>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=deposit$check[deposit]></CENTER>
	</TD>
	<TD width=50>
	<CENTER><INPUT TYPE=radio NAME=use[$id] VALUE=give$check[give]></CENTER>
	</TD>
	</TR>
	";
}

ECHO <<<END

<p align=center><a href=item_helper.php?game=$game>Item Helper</A> | <a href=myitems.php?game=$game>My Items</a> | <a href=myshop.php?game=$game>My Shop</a> | <a href=mygallery.php?game=$game>My Gallery</a> | <a href=battle_items.php?game=$game>Equipped Items</a> | <a href=safety_box.php?game=$game>Safety Box</a></p>

<CENTER><FORM ACTION="item_helper.pro.php?game=$game" METHOD=POST>
   <CENTER><FONT SIZE="-1"><TABLE CELLSPACING=0 CELLPADDING=0 WIDTH=500>
      <TR BGCOLOR="$topAndBottomBG" width=100%>
         <TD COLSPAN=8 HEIGHT=45>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText">--Item
            Helper--</FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG">
         <TD>
            <CENTER><FONT SIZE="-1">Item Name</FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game>Keep</a></FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game&check_all=stock>Stock</a></FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game&check_all=discard>Discard</a></FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game&check_all=donate>Donate</a></FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game&check_all=gallery>Gallery</a></FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game&check_all=deposit>Deposit</a></FONT></CENTER>
         </TD>
         <TD width=50>
            <CENTER><FONT SIZE="-1"><a href=item_helper.php?game=$game&check_all=give>Give</a></FONT></CENTER>
         </TD>
      </TR>
      $itemList
   </TABLE>
   <p align=center>Give items to: <input type=text name=give_to></p>

    <INPUT TYPE=submit NAME=Submit VALUE="Do it!"></FONT></CENTER>
</FORM></CENTER>

$closeHTML

END;

?>